myApp.controller('signinCtrl',function($scope, $state, $http){
	var userdata = {};
	$scope.submitForm = function(){
		var data = $scope.userdata
		console.log(data);
		$http({
			method: 'post',
			url: '/login',
			params: {
				data: data
			}
		}).success(function(data){
			if(data == 'not_user'){
				alert("邮箱不存在！");
				$state.reload();
			}else if(data == 'success'){
				alert("登陆成功");
				$state.go("/")
			}else{
				alert("用户名或密码错误!")
				$state.reload();
			}
		}).error(function(data){
			alert(data)
		});
	};
});


